package com.wl.cloud.security.constant;

/**
 * @author: wanglin
 * @date: 2023-09-20 周三
 * @Version: 1.0
 * @Description:
 */
public class SecurityConstants {

    /**
     * 令牌自定义标识
     */
    public static final String AUTHENTICATION = "Authorization";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 令牌秘钥
     */
    public static final String SECRET = "abcdefghijklmnopqrstuvwxyz";

    /**
     * 过期时间，默认分钟
     */
    public static final Long EXPIRATION = 30L;
    /**
     * 缓存刷新时间，默认分钟，token过期前10分钟之内，刷新token
     */
    public static final Long REFRESH_TIME = 10L;

    /**
     * 管理员
     */
    public static final String ADMIN = "ADMIN";
    /**
     * 超级管理员
     */
    public static final String SUPER_ADMIN = "SUPER_ADMIN";
    /**
     * 普通用户
     */
    public static final String COMMON = "COMMON";
    /**
     * 允许访问登录之后，访问没有配置角色的资源路径，如：getInfo,getRoutes
     */
    public static final String DEFAULT_COMMON = "DEFAULT_COMMON";

    /**
     * token创建时间
     */
    public static final String CLAIM_KEY_CREATED = "created";

    /**
     * 用户ID字段
     */
    public static final String DETAILS_USER_ID = "user_id";

    /**
     * 用户名字段
     */
    public static final String DETAILS_USERNAME = "username";

    /**
     * 用户标识
     */
    public static final String USER_KEY = "user_key";

    /**
     * 登录用户
     */
    public static final String LOGIN_USER = "login_user";

    /**
     * 角色权限
     */
    public static final String ROLE_PERMISSION = "role_permission";

    /**
     * 内部请求
     */
    public static final String INNER = "inner";
}
